import React, { Component } from 'react'
import avatar from '../images/avatar.png'
import '../index.css'
export class Form extends Component {
  state = {
    txt:'xxx'
  }
  TxtChange = (e) => {
    this.setState({
      txt:e.target.value
    })
  }
  render() {
    return (
      <div className="comment-send-container">
        <div>
          <img className="user-head" src={avatar} alt="头像" />
        </div>
        <div className="comment-send">
          <div className="textarea-container">
            <textarea
              cols="80"
              rows="5"
              placeholder="发条友善的评论"
                className="ipt-txt"
                value={this.state.txt}
                onChange={this.TxtChange}
            />
            <button className="comment-submit" onClick={()=>this.props.Submit(this.state.txt)}>发表评论</button>
          </div>
          <div className="comment-emoji">
            <i className="face"></i>
            <span className="text">表情</span>
          </div>
        </div>
      </div>
    )
  }
}

export default Form